<template>
  <el-table-column v-bind="item">
    <!-- 表头插槽 -->
    <template v-if="item.renderHeader" #header="scope">
      <component
        :is="item.renderHeader"
        :column="item"
        :row="scope.row"
      ></component>
    </template>
    <template v-if="item.render" #default="scope">
        <component :is="item.render" :row="scope.row"></component>
    </template>
    <!-- 如果有子集 -->
    <template v-if="item.children && item.children.length">
      <TableColumn
        v-for="(item, index) in item.children"
        :key="index"
        :item="item"
      />
    </template>
  </el-table-column>
</template>

<script setup lang="tsx">
import { ref, reactive, defineEmits, onMounted } from "vue";
import TableColumn from "/@/components/table/component/tableColumn.vue";
const state = reactive({});

defineProps({
  item: {
    type: Object,
    required: true,
  },
});
</script>

<style scoped lang="scss"></style>
